package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Purmb;
import com.clouds.wms.bean.Purmh;
import com.clouds.wms.bean.Purmg;
import com.clouds.wms.dao.PurmgDao;
import com.clouds.wms.dao.PurmhDao;
import com.clouds.wms.dao.PurmgDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("purmhService")
public class PurmhServiceImpl implements PurmhService {
	@Resource(name="purmgDao")
	private PurmgDao purmgDao;
	@Resource(name="purmhDao")
	private PurmhDao purmhDao;

	@Override
	public PagesBean getPurmhList(String mgaa, String mgab, int offset,int pageSize) throws SysException {
		return purmhDao.getPurmhList(mgaa, mgab, offset, pageSize);
	}

	@Override
	public int savePurmh(Purmh purmh) throws SysException {
		return purmhDao.savePurmh(purmh);
	}

	@Override
	public int getMaxMhac() throws SysException {
		return purmhDao.getMaxMhac();
	}

	@Override
	public int delPurmh(String mhaa, String mhab, String mhacs)	throws SysException {
		return purmhDao.delPurmh(mhaa, mhab, mhacs);
	}

	@Override
	public int updatePurmh(Purmh purmh) throws SysException {
		return purmhDao.updatePurmh(purmh);
	}

	@Override
	public int changeStatus(String mhaa, String mhab, String status)throws SysException {
		return purmhDao.changeStatus(mhaa, mhab, status);
	}

	@Override
	public void delPurmgmh(String mgaa, String mgab) throws SysException {
		purmgDao.delPurmgByAaAb(mgaa, mgab);
		purmhDao.delPurmhByAaAb(mgaa, mgab);
	}

	@Override
	public void delPurmhAll(String mgaa, String mgab) throws SysException {
		purmhDao.delPurmhByAaAb(mgaa, mgab);
	}
}
